﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace ApiTest.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class DataController : ControllerBase
    {
        private readonly IList<Item> _items = new List<Item>
        {
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 1", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 2", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 3", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 4", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 5", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 6", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 7", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 8", Description = "Just for test desc"},
            new Item{ Uuid = Guid.NewGuid(), Name="Data Item 9", Description = "Just for test desc"}
        };

        [HttpGet]
        public IList<Item> GetList()
        {
            return _items;
        }
    }

    public class Item
    {
        public string Name { get; set; }  
        public string Description { get; set; }  
        public Guid Uuid { get; set; }
    }
}